package web_model

import (
	"time"

	"gorm.io/gorm"
)

const TableNameSysPermission = "sys_permission"

// SysPermission mapped from table <sys_permission>
type SysPermission struct {
	ID             int64          `gorm:"column:id;type:integer;primaryKey" json:"id"`
	PermissionType string         `gorm:"column:permission_type;type:text(1)" json:"permission_type"`
	AppType        string         `gorm:"column:app_type;type:text(1)" json:"app_type"`
	Name           string         `gorm:"column:name;type:text(128)" json:"name"`
	Identify       string         `gorm:"column:identify;type:text(64)" json:"identify"`
	Action         string         `gorm:"column:action;type:text(64)" json:"action"`
	CreatedBy      string         `gorm:"column:created_by;type:text(20)" json:"created_by"`
	UpdatedBy      string         `gorm:"column:updated_by;type:text(20)" json:"updated_by"`
	CreatedAt      time.Time      `gorm:"column:created_at;type:DATETIME" json:"created_at"`
	UpdatedAt      time.Time      `gorm:"column:updated_at;type:DATETIME" json:"updated_at"`
	DeletedAt      gorm.DeletedAt `gorm:"column:deleted_at;type:DATETIME" json:"deleted_at"`
	TenantID       int64          `gorm:"column:tenant_id;type:integer" json:"tenant_id"`
}

// TableName SysPermission's table name
func (*SysPermission) TableName() string {
	return TableNameSysPermission
}
